package com.tdijoy.marqueen;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

/**
 * Create by liangkun on 2018/11/8
 * Describe :
 */

public class ZoomViewUtils {
    public static void zoomInAnim(final View view) {
        ObjectAnimator objectAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", 1.0f, 1.05f);
        ObjectAnimator objectAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 1.0f, 1.05f);
        objectAnimatorX.setDuration(200);
        objectAnimatorX.setInterpolator(new AccelerateDecelerateInterpolator());
        objectAnimatorY.setDuration(200);
        objectAnimatorY.setInterpolator(new AccelerateDecelerateInterpolator());
        AnimatorSet set = new AnimatorSet();
        set.playTogether(objectAnimatorX, objectAnimatorY);
        set.start();
    }
    public static void zoomOutAnim(final View view) {
        ObjectAnimator objectAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", 1.1f, 1.0f);
        ObjectAnimator objectAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 1.1f, 1.0f);
        objectAnimatorX.setDuration(500);
        objectAnimatorX.setInterpolator(new AccelerateDecelerateInterpolator());
        objectAnimatorY.setDuration(500);
        objectAnimatorY.setInterpolator(new AccelerateDecelerateInterpolator());
        AnimatorSet set = new AnimatorSet();
        set.playTogether(objectAnimatorX, objectAnimatorY);
        set.start();

    }

}
